home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / adainc / s-unstyp.ads < prev    next >
Text File  |  1996-01-30  |  6KB  |  177 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                          GNAT RUNTIME COMPONENTS                         --
  4. --                                                                          --
  5. --                S Y S T E M . U N S I G N E D _ T Y P E S                 --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.3 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- The GNAT library is free software; you can redistribute it and/or modify --
  14. -- it under terms of the GNU Library General Public License as published by --
  15. -- the Free Software  Foundation; either version 2, or (at your option) any --
  16. -- later version.  The GNAT library is distributed in the hope that it will --
  17. -- be useful, but WITHOUT ANY WARRANTY;  without even  the implied warranty --
  18. -- of MERCHANTABILITY  or  FITNESS FOR  A PARTICULAR PURPOSE.  See the  GNU --
  19. -- Library  General  Public  License for  more  details.  You  should  have --
  20. -- received  a copy of the GNU  Library  General Public License  along with --
  21. -- the GNAT library;  see the file  COPYING.LIB.  If not, write to the Free --
  22. -- Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.        --
  23. --                                                                          --
  24. ------------------------------------------------------------------------------
  25.  
  26. --  This package contains definitions of standard unsigned types that
  27. --  correspond in size to the standard signed types declared in Standard.
  28. --  and (unlike the types in Interfaces have corresponding names).
  29.  
  30. package System.Unsigned_Types is
  31. pragma Pure (Unsigned_Types);
  32.  
  33.    type Short_Short_Unsigned is mod 2 ** Short_Short_Integer'Size;
  34.    type Short_Unsigned       is mod 2 ** Short_Integer'Size;
  35.    type Unsigned             is mod 2 ** Integer'Size;
  36.    type Long_Unsigned        is mod 2 ** Long_Integer'Size;
  37.    type Long_Long_Unsigned   is mod 2 ** Long_Long_Integer'Size;
  38.  
  39.    function Shift_Left
  40.      (Value  : Short_Short_Unsigned;
  41.       Amount : Natural)
  42.      return    Short_Short_Unsigned;
  43.  
  44.    function Shift_Right
  45.      (Value  : Short_Short_Unsigned;
  46.       Amount : Natural)
  47.       return   Short_Short_Unsigned;
  48.  
  49.    function Shift_Right_Arithmetic
  50.      (Value  : Short_Short_Unsigned;
  51.       Amount : Natural)
  52.       return   Short_Short_Unsigned;
  53.  
  54.    function Rotate_Left
  55.      (Value  : Short_Short_Unsigned;
  56.       Amount : Natural)
  57.       return   Short_Short_Unsigned;
  58.  
  59.    function Rotate_Right
  60.      (Value  : Short_Short_Unsigned;
  61.       Amount : Natural)
  62.       return   Short_Short_Unsigned;
  63.  
  64.    function Shift_Left
  65.      (Value  : Short_Unsigned;
  66.       Amount : Natural)
  67.      return    Short_Unsigned;
  68.  
  69.    function Shift_Right
  70.      (Value  : Short_Unsigned;
  71.       Amount : Natural)
  72.       return   Short_Unsigned;
  73.  
  74.    function Shift_Right_Arithmetic
  75.      (Value  : Short_Unsigned;
  76.       Amount : Natural)
  77.       return   Short_Unsigned;
  78.  
  79.    function Rotate_Left
  80.      (Value  : Short_Unsigned;
  81.       Amount : Natural)
  82.       return   Short_Unsigned;
  83.  
  84.    function Rotate_Right
  85.      (Value  : Short_Unsigned;
  86.       Amount : Natural)
  87.       return   Short_Unsigned;
  88.  
  89.    function Shift_Left
  90.      (Value  : Unsigned;
  91.       Amount : Natural)
  92.      return    Unsigned;
  93.  
  94.    function Shift_Right
  95.      (Value  : Unsigned;
  96.       Amount : Natural)
  97.       return   Unsigned;
  98.  
  99.    function Shift_Right_Arithmetic
  100.      (Value  : Unsigned;
  101.       Amount : Natural)
  102.       return   Unsigned;
  103.  
  104.    function Rotate_Left
  105.      (Value  : Unsigned;
  106.       Amount : Natural)
  107.       return   Unsigned;
  108.  
  109.    function Rotate_Right
  110.      (Value  : Unsigned;
  111.       Amount : Natural)
  112.       return   Unsigned;
  113.  
  114.    function Shift_Left
  115.      (Value  : Long_Unsigned;
  116.       Amount : Natural)
  117.      return    Long_Unsigned;
  118.  
  119.    function Shift_Right
  120.      (Value  : Long_Unsigned;
  121.       Amount : Natural)
  122.       return   Long_Unsigned;
  123.  
  124.    function Shift_Right_Arithmetic
  125.      (Value  : Long_Unsigned;
  126.       Amount : Natural)
  127.       return   Long_Unsigned;
  128.  
  129.    function Rotate_Left
  130.      (Value  : Long_Unsigned;
  131.       Amount : Natural)
  132.       return   Long_Unsigned;
  133.  
  134.    function Rotate_Right
  135.      (Value  : Long_Unsigned;
  136.       Amount : Natural)
  137.       return   Long_Unsigned;
  138.  
  139.    function Shift_Left
  140.      (Value  : Long_Long_Unsigned;
  141.       Amount : Natural)
  142.      return    Long_Long_Unsigned;
  143.  
  144.    function Shift_Right
  145.      (Value  : Long_Long_Unsigned;
  146.       Amount : Natural)
  147.       return   Long_Long_Unsigned;
  148.  
  149.    function Shift_Right_Arithmetic
  150.      (Value  : Long_Long_Unsigned;
  151.       Amount : Natural)
  152.       return   Long_Long_Unsigned;
  153.  
  154.    function Rotate_Left
  155.      (Value  : Long_Long_Unsigned;
  156.       Amount : Natural)
  157.       return   Long_Long_Unsigned;
  158.  
  159.    function Rotate_Right
  160.      (Value  : Long_Long_Unsigned;
  161.       Amount : Natural)
  162.       return   Long_Long_Unsigned;
  163.  
  164.    pragma Convention (Intrinsic, Shift_Left);
  165.    pragma Convention (Intrinsic, Shift_Right);
  166.    pragma Convention (Intrinsic, Shift_Right_Arithmetic);
  167.    pragma Convention (Intrinsic, Rotate_Left);
  168.    pragma Convention (Intrinsic, Rotate_Right);
  169.  
  170.    pragma Import (Intrinsic, Shift_Left);
  171.    pragma Import (Intrinsic, Shift_Right);
  172.    pragma Import (Intrinsic, Shift_Right_Arithmetic);
  173.    pragma Import (Intrinsic, Rotate_Left);
  174.    pragma Import (Intrinsic, Rotate_Right);
  175.  
  176. end System.Unsigned_Types;
  177.